class Config_train(object):
    env = 'default'
    backbone = 'resnet18'  # 网络层，可进行替换，进行替换要改输出全连接层参数，否则报错
    classify = 'softmax'  # 分类采用softmax

    metric = 'arc_margin'  # 采用arc_margin
    easy_margin = False
    use_se = False
    loss = 'focal_loss'  # 损失采用foal_loss

    display = False # 动态展示
    finetune = False

    # train_root = 'data/Datasets/x_train'
    train_list = '../init_data/toUser/my_train_pair.txt'  # 包含训练图片路径及标签类别
    lfw_test_list = '../init_data/lfw/lfw_test_pair.txt'  # lfw图片路径以及标签
    lfw_root = '../init_data/lfw/lfw-align-128'  # lfw照片存储大文件夹
    save_interval = 10  # 每隔几轮保存权重
    train_batch_size = 64  # 训练 batch size 根据显存大小进行调整，能大尽量大
    test_batch_size = 64  # 测试 batch size

    input_shape = (1, 128, 128)  # 输入图片大小

    optimizer = 'sgd'  # 梯度下降函数

    use_gpu = True  # use GPU or not
    gpu_id = '0, 1'  # gpu ID
    num_workers = 4  # 并行处理加载数据 how many workers for loading data
    print_freq = 100  # 每隔多少个batch_size进行损失准确率计算并打印 print info every N batch

    max_epoch = 51  # 最大轮次
    lr = 1e-1  # 初始学习率 initial learning rate
    lr_step = 10  # 没隔几轮学习率进行衰减
    lr_decay = 0.95  # when val_loss increase, lr = lr*lr_decay
    weight_decay = 5e-4  # 权重衰减系数

    def __init__(self,train_root,num_classes,model_path):  # 初始化三个参数，对三个参数进行自定义
        self.train_root = train_root
        self.num_classes = num_classes
        self.model_path = model_path


class Config_test(object):
    env = 'default'
    backbone = 'resnet18'
    classify = 'softmax'

    metric = 'arc_margin'
    easy_margin = False
    use_se = False
    loss = 'focal_loss'

    display = False
    finetune = False

    # test_root = 'data/Datasets/x_test'
    test_list = '../init_data/toUser/my_test_pair.txt'
    test_model_path = 'model/resnet18_40.pth'

    test_batch_size = 60
    input_shape = (1, 128, 128)

    use_gpu = True  # use GPU or not
    gpu_id = '0, 1'
    num_workers = 4  # how many workers for loading data
    print_freq = 100  # print info every N batch

    def __init__(self,test_root,result_file):
        self.test_root = test_root
        self.result_file = result_file